<template>
  <div id="app">
    {{$store.getters.arr}}
    {{arr}}
    {{arr2}}
    {{age}}
    <button type="button" @click="fuzhi">赋值</button>
  </div>
</template>

<script>
export default {
  name: 'app',
  created(){
    
  },
  mounted(){
    //this.$store.dispatch("loadArr");
  },
  data () {
    return {
      arr2:[],
    }
  },
  methods:{
    fuzhi(){
      this.$store.dispatch("setAge",18);
    }
  },
  computed:{
   arr(){
     console.log(11111)
     //return this.$store.state.arr
     return 11
   },
   age(){
     console.log(this.$store.state)
     return this.$store.state.user.age
   }
  }
}
</script>

<style>
</style>
